package com.kyivmohyla.kma2.factory;

import com.kyivmohyla.kma2.dao.*;
import com.kyivmohyla.kma2.model.*;

import java.util.Map;

@SuppressWarnings("unchecked")
public class OracleDAOFactory extends DAOFactory {

    private Map<Class, Dao> daos;

    public void setDaos(Map<Class, Dao> daos) {
        this.daos = daos;
    }

    @Override
    public Dao<Customer> getCustomerDao() {
        return daos.get(CustomerDaoJdbc.class);
    }

    @Override
    public Dao<Equipment> getEquipmentDao() {
        return daos.get(EquipmentDaoJdbc.class);
    }

    @Override
    public Dao<History> getHistoryDao() {
        return daos.get(HistoryDaoJdbc.class);
    }

    @Override
    public Dao<Order> getOrderDao() {
        return daos.get(OrderDaoJdbc.class);
    }

    @Override
    public Dao<OrderServEquip> getOrderServEquipDao() {
        return daos.get(OrderServEquipDaoJdbc.class);
    }

    @Override
    public Dao<Position> getPositionDao() {
        return daos.get(PositionDaoJdbc.class);
    }

    @Override
    public Dao<Refs> getRefsDao() {
        return daos.get(RefsDaoJdbc.class);
    }

    @Override
    public Dao<Service> getServiceDao() {
        return daos.get(ServiceDaoJdbc.class);
    }

    @Override
    public Dao<Staff> getStaffDao() {
        return daos.get(StaffDaoJdbc.class);
    }

    @Override
    public Dao<State> getStateDao() {
        return daos.get(StateDaoJdbc.class);
    }
}
